<style type="text/css" scoped >


.my-container{
	box-sizing:border-box;
	height: 100%;
	padding:0.1rem;
	
}
.my-title{	
	width:100%;
	text-align:center;
	
	font-size:0.4rem;
	color:#DDDDDD;
	text-shadow: 0.03rem 0.03rem 0.1rem #DDDDDD;/*文字阴影*/
	font-weight:bold;
	letter-spacing:0.05rem;/*文字距离*/	
}

</style>



<template>

    <div class="my-container">
        <div style="height:15%;"></div>
        <div class="my-title">宜染xx在线</div>
        <div style="height:10%;"></div>
        
        <mt-field label="帐号" placeholder="请输入帐号"  v-model="user.u_id"  ></mt-field>
        <mt-field label="密码" placeholder="请输入密码" type="password" v-model="user.u_pwd"  ></mt-field>

        <div  style="height:5%;"></div>
        <div><mt-button type="primary" size="large" @click.native="login" >登录</mt-button></div>
        <div style="height:10%;"></div>
        <div style="text-align:center;color:#AAAAAA;"  >技术支持：XXX软件有限公司</div>
    </div>

</template>




<script type="text/javascript">

	export default {
		name:'SaftyLogin',
		data(){
            return {
			   
			   user:{}
                
            };
        },
		methods:{
			
			login(){
				
				this.$axios.post('/safty/login/login',this.user)
					.then((response)=>{
						let result = response.data;
						if(result.success){
							
							let toast = this.$toast({
								message: result.message,
								iconClass: 'fa fa-check fa-3x', //使用font-awesome的字体图标
								duration:1000 
							});

							setTimeout(()=>{                
								this.$router.push('/safty/home');
							},1200);
							
						}else{
							
							this.$messagebox.alert(result.message);
							
						}
					})
					.catch((error)=>{
						console.log(error);
					});
			}

		}
	};


</script>